CKEDITOR.dialog.add('smarttable', function(editor) {
	return {
		title: '表格管理',
		minWidth: 600,
		minHeight: 350,
		contents: [{
			id: 'info',
			label: '配置',
			elements: [{
				id: 'myhtml',
				type: 'html',
				label: '这是一个HTML',
				html: '',
				onShow: function() {
					SmartTable.getConfigHtml(this.getElement().$);
				},
				commit: function(widget) {
					widget.setData('r', 'r' + new Date().valueOf());
				}
			}]
		}, {
			id: 'chartConf',
			label: 'Chart',
			disabled: false,
			elements: [{
				id: 'myhtml2',
				type: 'html',
				label: '这是一个HTML',
				html: '',
				onShow: function() {
					if(!SmartTable.chartConfHtml){
						SmartTable.chartConfHtml = this.getElement().$;
					}
				}
			}]
		}],
		onOk: function() {
			smartTableOkSign = true;
			var dialogEle = this.getElement().$;
			SmartTable.getDialogParam(dialogEle);
			SmartTable.getDialogChartParam(dialogEle);
		},
		onCancel: function() {
			SmartTable.clearParams();
		},
		onShow: function() {
			SmartTable.dialog = this;
			if(SmartTable.tableData){
				this.showPage('chartConf');				
				setTimeout(function(){
					SmartTable.previewTable();
				},200);				
			}else{
				this.hidePage('chartConf');
			}
		}
	};
});